<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div
      class="content-bg outline-parent-bg border-hover-style"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style14/Level2outlineStyle1Bg.webp'})`,
      }"
    >
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div class="left-content" :class="{ 'only-remarks': !props.info.subTitle && !props.info.value }">
        <p class="sub-title" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
        <div class="remarks1" v-if="props.info.value" :class="{ 'null-sub-title': !props.info.subTitle }">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="getRemarksNum(10, route.meta.loopType)"
          ></TextMax>
        </div>
        <div class="remarks2" v-else-if="props.info.remarks" :class="{ 'null-sub-title': !props.info.subTitle }">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="
              !props.info.subTitle ? getRemarksNum(18, route.meta.loopType) : getRemarksNum(17, route.meta.loopType)
            "
          ></TextMax>
        </div>
        <div class="img-box" v-if="props.info.value">
          <img
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/w/1000/format/webp'"
            alt=""
            class="level1-img"
          />
        </div>
      </div>
      <div class="right-content">
        <p class="title" v-if="props.info.text">{{ props.info.text }}</p>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default defineComponent({
  name: 'free14Style1',
});
</script>
<script lang="ts" setup>
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style14.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/textMax14.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
  indexs: {
    type: Number || String,
  },
});
</script>

<style lang="less" scoped>
.outline-parent {
  display: flex;
  align-items: flex-end;
  position: relative;
  // margin-right: 140px;
  margin-left: 40px;
  margin-top: 0;
  height: 100%;
}
.content-bg {
  display: flex;
  position: relative;
  width: 550px;
  height: 774px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.Showroom-parent {
  position: absolute;
  top: 0;
  right: 12px;
}
.left-content {
  display: flex;
  flex-direction: column;
  width: 380px;
  height: 704px;
  flex-shrink: 0;
  padding: 0 30px 50px 50px;
  margin: 44px 22px 0 63px;
}
.sub-title {
  margin-top: 40px;
  color: #777;
  text-align: center;
  flex-shrink: 0;
  /* 一级副标 */
  font-family: 'SourceHanSerifCN';
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px; /* 155.556% */
}
.remarks1 {
  flex-shrink: 0;
  width: 300px;
  margin-top: 24px;
}
.remarks2 {
  flex-shrink: 0;
  width: 300px;
  margin-top: 24px;
}
.only-remarks {
  justify-content: center;
  .remarks1 {
    margin: 0;
  }
  .remarks2 {
    margin: 0;
  }
}
.null-sub-title {
  margin-top: 81px;
}
.img-box {
  width: 300px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f0e3;
  overflow: hidden;
  margin-top: 16px;
}
.level1-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.5s;
}
.img-box:hover {
  .level1-img {
    transform: scale(1.2);
  }
}
.right-content {
  flex-shrink: 0;
  width: 44px;
  height: 648px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 72px;
  margin-right: 38px;
}
.title {
  color: #fff;
  text-align: center;

  /* 二级标题 */
  font-family: 'SourceHanSerifCN';
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  line-height: 36px; /* 150% */
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 10px;
}
</style>
